import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopDispatchAutosendController } from '../../../controllers';
const uctoominishopDispatchAutosendRouter = new Router();
const minishopDispatchAutosendController = new uctooMinishopDispatchAutosendController();

uctoominishopDispatchAutosendRouter.post('/add', requireUser, minishopDispatchAutosendController.add);
uctoominishopDispatchAutosendRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_dispatch_autosend'), minishopDispatchAutosendController.edit);
uctoominishopDispatchAutosendRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_dispatch_autosend'), minishopDispatchAutosendController.delete);

//For getting minishopDispatchAutosend with permission control
uctoominishopDispatchAutosendRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_autosend'), minishopDispatchAutosendController.getSingle);
uctoominishopDispatchAutosendRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_autosend'), minishopDispatchAutosendController.getMany);
uctoominishopDispatchAutosendRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_autosend'), minishopDispatchAutosendController.getMany);

//#endregion AutoCreateCode
export default uctoominishopDispatchAutosendRouter;
